using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Evaluation3.classes ;
using Evaluation3.interfaces ;
using Evaluation3.utils;
public partial class uicontrol_controlMenu : System.Web.UI.UserControl
{
    private Hashtable MenuMap = new Hashtable();
    private Hashtable MenuItem = new Hashtable();
    private ArrayList Panels = new ArrayList();
    protected void Page_Load(object sender, EventArgs e)
    {
        initMenu();
        renderControlPanel();
    }
    private remoteUser getRemoteUser() {
        return (remoteUser)Session["remoteUser"];
    }
    protected void initMenu() {
        Panels.Add(adminControlPanel);
        Panels.Add(adminCompControlPanel);
        Panels.Add(userCompControlPanel);
     
    }
    protected void loadDrawingObj(Object sender, EventArgs e) {
        Response.Redirect("default.aspx?mod=draw");
    }
    protected void renderControlPanel() {
        foreach(Object o in Panels) {
            ((Panel)o).Visible = false;
        }
        if (remoteUser.ROLE_GLOBAL_ADMIN.Equals(getRemoteUser().uRight))
        {
            adminControlPanel.Visible = true;
        } else  if (remoteUser.ROLE_COMPANY_ADMIN.Equals(getRemoteUser().uRight)) {
            adminCompControlPanel.Visible = true;
        }
        else if (remoteUser.ROLE_COMPANY_USER.Equals(getRemoteUser().uRight)) {
            userCompControlPanel.Visible = true;
        }
    }
      
}
